package com.we.risk.phoneRecord.common;

import com.we.risk.phoneRecord.stage2.adm.PhoneCallLabel;

import java.util.*;

public class Stage2GlobalSetting {
    public static final String V1CLEANDATA =
            "hdfs:///data/dim/llb_reg_address_level_v1_clean/v1_clean_data";
    public static final String V1DATA = "hdfs:///data/dim/llb_reg_address_level_v1/v1_data";
    //仅适用于通话记录/通讯录手机号地址清洗
    public static final String V1MOBAREAISPFORMAT = "hdfs:///data/dim/phone_format_prov_city_isp/phone_format_porv_city_isp";

    public static final String SGCSTAGDATA =
            "hdfs:///data/dim/llb_phone_sougou_cuishou_tag/sougou_cuishou_tag_data";
    public static final String CSTAGV2DATA = "hdfs:///data/dim/callrecord_cstag_v2/callrecord_cstag_v2";

    public static final String V1CATCHFILENAME = "llb_reg_address_level_v1";
    public static final String V1CLEANCATCHFILENAME = "llb_reg_address_level_v1_clean";
    public static final String V1MOBAREAISPFORMATFILENAME = "phone_format_prov_city_isp_v1";
    public static final String SGCSCATCHFILENAME = "sougou_cuishou_tag";
    public static final String CSV2CATCHFILENAME = "cs_tag_v2";

    public static final String PIDAREDATA = "hdfs:///data/dim/hive_udf_pid_data/pid_area.data";
    //    public static final String MOBAREADATA = "hdfs:///data/dim/dc_mobile_area/1106.data";
    public static final String MOBAREADATA =
            "hdfs:///data/dim/hive_udf_mobile_data/mobile_area.data";
    public static final String MOBAREAISPDATA =
            "hdfs:///data/dim/hive_udf_phone_book/hive_udf_phone_book.data";
    public static final String PIDAREAFILENAME = "pid_area_data";
    public static final String MOBAREAFILENAME = "mob_area_data";
    public static final String MOBAREAISPFILENAME = "mob_area_isp_data";

    public static final String MOBILE_AREA_KFK_BOOTADD =
            "10.10.15.25:9092,10.10.15.26:9092,10.10.15.27:9092";
    //    public static final String MOBILE_AREA_KFK_TOPIC = "dim_ris01_dc_mobile_area";
    public static final String MOBILE_AREA_KFK_TOPIC = "dim_udf_phone_data";
    public static final String MOBILE_AREA_KFK_GRP_ID = "mobile_area_kfk_group_id_1104";
    public static final String KFKMOBAREATOPICGRPID = "DimPhoneRecordLabel_csm_grp_1104";

    public static final String PID_AREA_KFK_TOPIC = "dim_pdl02_risk_verify_idno_area";
    public static final String PID_AREA_KFK_GRP_ID = "pid_area_kfk_group_id_1104";

    public static final int LASTDAY1 = 1;
    public static final int LASTDAY15 = 15;
    public static final int LASTDAY30 = 30;
    public static final int LASTDAY90 = 90;
    public static final int LASTDAY180 = 180;

    public static final String ALL = "all";
    public static final String BEMORNING = "bemorning";
    public static final String MORNING = "morning";
    public static final String AFTERNOON = "afternoon";
    public static final String NIGHT = "night";
    public static final String FIX = "fix";
    public static final String MOBILE = "mobile";
    public static final String BLOCKED = "blocked";
    public static final String INCOMING = "incoming";
    public static final String MISSED = "missed";
    public static final String OUTGOING = "outgoing";
    public static final String REJECTED = "rejected";
    public static final String UNKNOWN = "unknown";
    public static final String NUMBER1 = "number1";
    public static final String NUMBER2 = "number2";
    public static final String NUMBER3 = "number3";
    public static final String NUMBER4 = "number4";
    public static final String NUMBER5 = "number5";
    public static final String NUMBER6 = "number6";
    public static final String NUMBER7 = "number7";
    public static final String NUMBER8 = "number8";
    public static final String NUMBER9 = "number9";
    public static final String NUMBER10 = "number10";
    public static final String NUMBER11 = "number11";
    public static final String NUMBER12 = "number12";
    public static final String NUMBER13 = "number13";
    public static final String NUMBER14 = "number14";
    public static final String NUMBER15 = "number15";
    public static final String NUMBER16 = "number16";
    public static final String NUMBER17 = "number17";
    public static final String NUMBER18 = "number18";
    public static final String NUMBER19 = "number19";
    public static final String NUMBER20 = "number20";
    public static final String NUMBER21 = "number21";
    public static final String NUMBER22 = "number22";
    public static final String NUMBER23 = "number23";
    public static final String NUMBER24 = "number24";
    public static final String NUMBER25 = "number25";
    public static final String NUMBER26 = "number26";
    public static final String NUMBER27 = "number27";
    public static final String NUMBER28 = "number28";
    public static final String NUMBER29 = "number29";
    public static final String NUMBER30 = "number30";
    public static final String NUMBER31 = "number31";
    public static final String NUMBER32 = "number32";
    public static final String NUMBER33 = "number33";
    public static final String NUMBER34 = "number34";
    public static final String NUMBER35 = "number35";
    public static final String NUMBER36 = "number36";
    public static final String NUMBER37 = "number37";
    public static final String NUMBER38 = "number38";
    public static final String NUMBER39 = "number39";
    public static final String NUMBER40 = "number40";
    public static final String NUMBER41 = "number41";
    public static final String NUMBER42 = "number42";
    public static final String NUMBER43 = "number43";

    public static final String NOBOOK = "nobook";
    public static final String BOOK = "book";

    /** 只和d1-d180组合 */
    public static final String ELSE = "else";

    public static final String BAOXIAN = "baoxian";
    public static final String DACHE = "dache";
    public static final String DAIKUAN = "daikuan";
    public static final String GOUWU = "gouwu";
    public static final String GUANGGAO = "guanggao";
    public static final String KEFU = "kefu";
    public static final String KUAIDI = "kuaidi";
    public static final String SAORAO = "saorao";
    public static final String WAIMAI = "waimai";
    public static final String XINYONGKA = "xinyongka";
    public static final String YINHANG = "yinhang";
    public static final String YUNYINGSHANG = "yunyingshang";
    public static final String ZHONGJIE = "zhongjie";
    public static final String CS = "cs";

    public static final String D1 = "d1";
    public static final String D15 = "d15";
    public static final String D30 = "d30";
    public static final String D90 = "d90";
    public static final String D180 = "d180";

    public static final String MOBPROV1 = "mobileprov1";
    public static final String MOBPROV0 = "mobileprov0";
    public static final String MOBCITY1 = "mobilecity1";
    public static final String MOBCITY0 = "mobilecity0";
    public static final String ADDRPROV1 = "addrprov1";
    public static final String ADDRPROV0 = "addrprov0";
    public static final String ADDRCITY1 = "addrcity1";
    public static final String ADDRCITY0 = "addrcity0";
    public static final String PIDPROV1 = "pidprov1";
    public static final String PIDPROV0 = "pidprov0";
    public static final String PIDCITY1 = "pidcity1";
    public static final String PIDCITY0 = "pidcity0";

    /**
     * Test
     *
     * @param args
     */
    public static void main(String[] args) {
        String[] hourGrpCalltype = {BEMORNING, MORNING, AFTERNOON, NIGHT, INCOMING, OUTGOING};

        HashMap<String, PhoneCallLabel> initMap = new HashMap<>();
        HashMap<String, PhoneCallLabel> MapBook = new HashMap<>();
        HashMap<String, PhoneCallLabel> MapD180 = new HashMap<>();
        HashMap<String, PhoneCallLabel> SgMap = new HashMap<>();
        HashMap<String, PhoneCallLabel> addrMap = new HashMap<>();

        initMap.put(ALL, new PhoneCallLabel());
        initMap.put(BEMORNING, new PhoneCallLabel());
        initMap.put(MORNING, new PhoneCallLabel());
        initMap.put(AFTERNOON, new PhoneCallLabel());
        initMap.put(NIGHT, new PhoneCallLabel());
        initMap.put(FIX, new PhoneCallLabel());
        initMap.put(MOBILE, new PhoneCallLabel());
        initMap.put(BLOCKED, new PhoneCallLabel());
        initMap.put(INCOMING, new PhoneCallLabel());
        initMap.put(OUTGOING, new PhoneCallLabel());
        initMap.put(MISSED, new PhoneCallLabel());
        initMap.put(REJECTED, new PhoneCallLabel());
        initMap.put(UNKNOWN, new PhoneCallLabel());
        initMap.put(NUMBER1, new PhoneCallLabel());
        initMap.put(NUMBER2, new PhoneCallLabel());
        initMap.put(NUMBER3, new PhoneCallLabel());
        initMap.put(NUMBER4, new PhoneCallLabel());
        initMap.put(NUMBER5, new PhoneCallLabel());
        initMap.put(NUMBER6, new PhoneCallLabel());
        initMap.put(NUMBER7, new PhoneCallLabel());
        initMap.put(NUMBER8, new PhoneCallLabel());
        initMap.put(NUMBER9, new PhoneCallLabel());
        initMap.put(NUMBER10, new PhoneCallLabel());
        initMap.put(NUMBER11, new PhoneCallLabel());
        initMap.put(NUMBER12, new PhoneCallLabel());
        initMap.put(NUMBER13, new PhoneCallLabel());
        initMap.put(NUMBER14, new PhoneCallLabel());
        initMap.put(NUMBER15, new PhoneCallLabel());
        initMap.put(NUMBER16, new PhoneCallLabel());
        initMap.put(NUMBER17, new PhoneCallLabel());
        initMap.put(NUMBER18, new PhoneCallLabel());
        initMap.put(NUMBER19, new PhoneCallLabel());
        initMap.put(NUMBER20, new PhoneCallLabel());
        initMap.put(NUMBER21, new PhoneCallLabel());
        initMap.put(NUMBER22, new PhoneCallLabel());
        initMap.put(NUMBER23, new PhoneCallLabel());
        initMap.put(NUMBER24, new PhoneCallLabel());
        initMap.put(NUMBER25, new PhoneCallLabel());
        initMap.put(NUMBER26, new PhoneCallLabel());
        initMap.put(NUMBER27, new PhoneCallLabel());
        initMap.put(NUMBER28, new PhoneCallLabel());
        initMap.put(NUMBER29, new PhoneCallLabel());
        initMap.put(NUMBER30, new PhoneCallLabel());
        initMap.put(NUMBER31, new PhoneCallLabel());
        initMap.put(NUMBER32, new PhoneCallLabel());
        initMap.put(NUMBER33, new PhoneCallLabel());
        initMap.put(NUMBER34, new PhoneCallLabel());
        initMap.put(NUMBER35, new PhoneCallLabel());
        initMap.put(NUMBER36, new PhoneCallLabel());
        initMap.put(NUMBER37, new PhoneCallLabel());
        initMap.put(NUMBER38, new PhoneCallLabel());
        initMap.put(NUMBER39, new PhoneCallLabel());
        initMap.put(NUMBER40, new PhoneCallLabel());
        initMap.put(NUMBER41, new PhoneCallLabel());
        initMap.put(NUMBER42, new PhoneCallLabel());
        initMap.put(NUMBER43, new PhoneCallLabel());

        Set<String> keySet = initMap.keySet();

        MapBook.put(NOBOOK, new PhoneCallLabel());
        MapBook.put(BOOK, new PhoneCallLabel());
        Set<String> BookSet = MapBook.keySet();

        HashMap<String, PhoneCallLabel> tmpMap = new HashMap<>();
        for (String set : BookSet) {
            for (String key : keySet) {
                //                if(key.equals(ALL)) {
                //                    tmpMap.put(set, new PhoneCallLabel());
                //                } else {
                //                    tmpMap.put(key+"_"+set, new PhoneCallLabel());
                //                }
                tmpMap.put(key + "_" + set, new PhoneCallLabel());
            }
        }
        initMap.putAll(tmpMap);

        MapD180.put(D1, new PhoneCallLabel());
        MapD180.put(D15, new PhoneCallLabel());
        MapD180.put(D30, new PhoneCallLabel());
        MapD180.put(D90, new PhoneCallLabel());
        MapD180.put(D180, new PhoneCallLabel());
        Set<String> set180 = MapD180.keySet();
        Set<String> keySet2 = initMap.keySet();
        HashMap<String, PhoneCallLabel> tmp180Map = new HashMap<>();

        for (String set : set180) {
            for (String key : keySet2) {
                //                if(key.equals(ALL)) {
                //                    tmp180Map.put(set, new PhoneCallLabel());
                //                } else {
                //                    tmp180Map.put(key+"_"+set, new PhoneCallLabel());
                //                }
                tmp180Map.put(key + "_" + set, new PhoneCallLabel());
            }
        }
        initMap.putAll(tmp180Map);

        SgMap.put(ELSE, new PhoneCallLabel());
        SgMap.put(BAOXIAN, new PhoneCallLabel());
        SgMap.put(DACHE, new PhoneCallLabel());
        SgMap.put(DAIKUAN, new PhoneCallLabel());
        SgMap.put(GOUWU, new PhoneCallLabel());
        SgMap.put(GUANGGAO, new PhoneCallLabel());
        SgMap.put(KEFU, new PhoneCallLabel());
        SgMap.put(KUAIDI, new PhoneCallLabel());
        SgMap.put(SAORAO, new PhoneCallLabel());
        SgMap.put(WAIMAI, new PhoneCallLabel());
        SgMap.put(XINYONGKA, new PhoneCallLabel());
        SgMap.put(YINHANG, new PhoneCallLabel());
        SgMap.put(YUNYINGSHANG, new PhoneCallLabel());
        SgMap.put(ZHONGJIE, new PhoneCallLabel());
        SgMap.put(CS, new PhoneCallLabel());

        initMap.putAll(SgMap);
        Set<String> sgSet = SgMap.keySet();
        HashMap<String, PhoneCallLabel> tmpSgMap = new HashMap<>();

        for (String set : sgSet) {
            for (String key : set180) {
                tmpSgMap.put(set + "_" + key, new PhoneCallLabel());
            }
        }
        initMap.putAll(tmpSgMap);

        addrMap.put(MOBPROV1, new PhoneCallLabel());
        addrMap.put(MOBPROV0, new PhoneCallLabel());
        addrMap.put(MOBCITY1, new PhoneCallLabel());
        addrMap.put(MOBCITY0, new PhoneCallLabel());
        addrMap.put(ADDRPROV1, new PhoneCallLabel());
        addrMap.put(ADDRPROV0, new PhoneCallLabel());
        addrMap.put(ADDRCITY1, new PhoneCallLabel());
        addrMap.put(ADDRCITY0, new PhoneCallLabel());
        addrMap.put(PIDPROV1, new PhoneCallLabel());
        addrMap.put(PIDPROV0, new PhoneCallLabel());
        addrMap.put(PIDCITY1, new PhoneCallLabel());
        addrMap.put(PIDCITY0, new PhoneCallLabel());
        initMap.putAll(addrMap);

        Set<String> addrSet = addrMap.keySet();
        HashMap<String, PhoneCallLabel> tmpAddrMap = new HashMap<>();
        for (String set : addrSet) {
            for (String key : hourGrpCalltype) {
                tmpAddrMap.put(set + "_" + key, new PhoneCallLabel());
            }
        }
        for (String set : addrSet) {
            for (String key : set180) {
                tmpAddrMap.put(set + "_" + key, new PhoneCallLabel());
            }
        }
        for (String set : addrSet) {
            for (String key : BookSet) {
                tmpAddrMap.put(set + "_" + key, new PhoneCallLabel());
            }
        }
        initMap.putAll(tmpAddrMap);

        Set<String> resSet = initMap.keySet();
        System.out.println("keySetSize: " + resSet.size());
        ArrayList<String> res = new ArrayList<>();
        for (String key : resSet) {
            //            if(key.equals(ALL)) {
            //                res.add("call_cnt");
            //                res.add("call_numbers");
            //                res.add("call_duration");
            //            } else {
            //                res.add("call_" + key + "_cnt");
            //                res.add("call_" + key + "_numbers");
            //                res.add("call_" + key + "_duration");
            //            }
            if (key.contains(ALL + "_")) {
                key = key.replace(ALL + "_", "");
            }
            if (key.contains(ALL)) {
                key = key.replace(ALL, "");
            }
            if (key.equals("")) {
                res.add("call_cnt");
                res.add("call_numbers");
                res.add("call_duration");
            } else {
                res.add("call_" + key + "_cnt");
                res.add("call_" + key + "_numbers");
                res.add("call_" + key + "_duration");
            }
        }
        Collections.sort(res);
        System.out.println("listSize:" + res.size());
        Iterator<String> iterator = res.iterator();
        while (iterator.hasNext()) {
            System.out.println(iterator.next());
        }
    }
}
